package com.youbug.mall.member_ums.web;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.youbug.common.to.OrderTo;
import com.youbug.common.vo.R;
import com.youbug.mall.member_ums.feign.IMemberOrderFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
@RequestMapping("/mall/member")
public class MallMemberController {

    @Autowired
    private IMemberOrderFeignService memberOrderFeignService;

    @RequestMapping("/memberOrder.html")
//    public String memberOrder(@RequestParam("out_trade_no") String outTradeNo, Model model){
    public String memberOrder(Model model){

        R<IPage<OrderTo>> orders = memberOrderFeignService.getOrderWithItem();

        model.addAttribute("orders",orders.getData());

        return "orderList";
    }
}
